package org.terramagnet.pdmviewer.parser;

import java.util.LinkedHashMap;
import java.util.Map;

public class PDMTable extends PDMObject{

    private String id;
    private String name;
    private String code;
    private String user;
    private final Map<String, PDMColumn> columns = new LinkedHashMap<>();
    private final Map<String, PDMKey> keys = new LinkedHashMap<>();
    private PDMKey primaryKey;
    private final Map<String, PDMIndex> indexs = new LinkedHashMap<>();

    /**
     * @return the id
     */
	@Override
    public String getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

    /**
     * @param code the code to set
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * @return the user
     */
    public String getUser() {
        return user;
    }

    /**
     * @param user the user to set
     */
    public void setUser(String user) {
        this.user = user;
    }

    /**
     * @return the columns
     */
    public Map<String, PDMColumn> getColumns() {
        return columns;
    }

    /**
     * @return the keys
     */
    public Map<String, PDMKey> getKeys() {
        return keys;
    }

    /**
     * @return the primaryKey
     */
    public PDMKey getPrimaryKey() {
        return primaryKey;
    }

    /**
     * @param primaryKey the primaryKey to set
     */
    public void setPrimaryKey(PDMKey primaryKey) {
        this.primaryKey = primaryKey;
    }

    /**
     * @return the indexs
     */
    public Map<String, PDMIndex> getIndexs() {
        return indexs;
    }

    @Override
    public String toString() {
        return "PDMTable{" + "id=" + id + ", name=" + name + ", code=" + code + ", user=" + user + ", columns=" + columns + ", keys=" + keys + ", primaryKey=" + primaryKey + ", indexs=" + indexs + '}';
    }

}
